package com.jl15988.mybatispluskit.join.model;

import com.jl15988.mybatispluskit.join.enums.JoinType;

/**
 * 关联信息类
 * 用于存储表与表之间的关联信息
 * 
 * @author Jalon
 * @since 2025/1/1
 */
public class JoinInfo {
    
    /**
     * 关联类型
     */
    private JoinType joinType;
    
    /**
     * 主表别名
     */
    private String mainTableAlias;
    
    /**
     * 关联表名
     */
    private String joinTableName;
    
    /**
     * 关联表别名
     */
    private String joinTableAlias;
    
    /**
     * 主表关联字段
     */
    private String mainField;
    
    /**
     * 关联表关联字段
     */
    private String joinField;
    
    /**
     * 关联表实体类
     */
    private Class<?> joinEntityClass;
    
    /**
     * 默认构造函数
     */
    public JoinInfo() {
    }
    
    /**
     * 构造函数
     * 
     * @param joinType 关联类型
     * @param mainTableAlias 主表别名
     * @param joinTableName 关联表名
     * @param joinTableAlias 关联表别名
     * @param mainField 主表关联字段
     * @param joinField 关联表关联字段
     * @param joinEntityClass 关联表实体类
     */
    public JoinInfo(JoinType joinType, String mainTableAlias, String joinTableName, 
                    String joinTableAlias, String mainField, String joinField, Class<?> joinEntityClass) {
        this.joinType = joinType;
        this.mainTableAlias = mainTableAlias;
        this.joinTableName = joinTableName;
        this.joinTableAlias = joinTableAlias;
        this.mainField = mainField;
        this.joinField = joinField;
        this.joinEntityClass = joinEntityClass;
    }
    
    // Getter 和 Setter 方法
    
    public JoinType getJoinType() {
        return joinType;
    }
    
    public void setJoinType(JoinType joinType) {
        this.joinType = joinType;
    }
    
    public String getMainTableAlias() {
        return mainTableAlias;
    }
    
    public void setMainTableAlias(String mainTableAlias) {
        this.mainTableAlias = mainTableAlias;
    }
    
    public String getJoinTableName() {
        return joinTableName;
    }
    
    public void setJoinTableName(String joinTableName) {
        this.joinTableName = joinTableName;
    }
    
    public String getJoinTableAlias() {
        return joinTableAlias;
    }
    
    public void setJoinTableAlias(String joinTableAlias) {
        this.joinTableAlias = joinTableAlias;
    }
    
    public String getMainField() {
        return mainField;
    }
    
    public void setMainField(String mainField) {
        this.mainField = mainField;
    }
    
    public String getJoinField() {
        return joinField;
    }
    
    public void setJoinField(String joinField) {
        this.joinField = joinField;
    }
    
    public Class<?> getJoinEntityClass() {
        return joinEntityClass;
    }
    
    public void setJoinEntityClass(Class<?> joinEntityClass) {
        this.joinEntityClass = joinEntityClass;
    }
    
    @Override
    public String toString() {
        return "JoinInfo{" +
                "joinType=" + joinType +
                ", mainTableAlias='" + mainTableAlias + '\'' +
                ", joinTableName='" + joinTableName + '\'' +
                ", joinTableAlias='" + joinTableAlias + '\'' +
                ", mainField='" + mainField + '\'' +
                ", joinField='" + joinField + '\'' +
                ", joinEntityClass=" + joinEntityClass +
                '}';
    }
} 